#ifndef DRV_RTC_H
#define DRV_RTC_H

#include "main.h"

typedef struct {
    unsigned char hour;
    unsigned char mins;
    unsigned char secs;
} rtc_time_t;

typedef struct {
    unsigned char year;
    unsigned char month;
    unsigned char day;
    unsigned char wday;
} rtc_date_t;

typedef struct {
    rtc_time_t time;
    rtc_date_t date;
} rtc_date_time_t;

enum {
    DATE_MONDAY = 0x01,
    DATE_TUESDAY,
    DATE_WEDNESDAY,
    DATE_THURSDAY,
    DATE_FRIDAY,
    DATE_SATURDAY,
    DATE_SUNDAY
};

void drv_rtc_init(void);
void drv_rtc_update(void);
void drv_rtc_SetTime(rtc_date_time_t *dat);
void drv_rtc_GetTime(rtc_date_time_t *dat);
void drv_rtc_SetTimestamp(unsigned int tsmp);
unsigned int drv_rtc_GetTimestamp(void);
#endif 